package com.example.consumer.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author kuang
 * @Date 2021/7/12 23:48
 */
@Configuration
public class ContextConfig {

    @Bean
    @LoadBalanced//赋予restTemplate负载均衡的功能
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
